package com.suse.jd_system_server.auto.service.impl;


import com.suse.jd_system_server.auto.mapper.UserMapper;
import com.suse.jd_system_server.auto.entity.User;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.suse.jd_system_server.auto.service.UserService;
/**
 *@作者:lhj
 *Service实现类
 *@Date:2023/10/18
*/
@Service
public class UserServiceImpl  implements UserService{


	@Resource
	private UserMapper userdao;


	/**
	根据User_id查询
	*/
	public Object selectByUser_id(Long user_id){
		return userdao.selectByUser_id(user_id);
	}


	/**
	根据User_id更新
	*/
	public Integer updateByUser_id(User demo){
		return userdao.updateByUser_id( demo);
	}



	/**
	根据User_id删除
	*/
	public Integer deleteByUser_id(Long user_id){
		return userdao.deleteByUser_id(user_id);
	}





	/**
	 insert:(插入)
	*/
	public Object insert(User demo){
		userdao.insert(demo);
		return demo;
	}



	/**
	 insertOrUpdate(插入或更新(根据主键或唯一索引更新，主键和唯一索引不会改变))
	*/
	public Integer insertOrUpdate(User demo){
		return userdao.insertOrUpdate(demo);
	}



	/**
	 insertBath:(批量插入)
	*/
	public Integer insertBatch(List<User> list){
		return userdao.insertBatch(list);
	}



	/**
	 insertOrUpdateBatch:(批量插入或更新)
	*/
	public Integer insertOrUpdateBatch(List<User> list){
		return userdao.insertOrUpdateBatch(list);
	}



	/**
	 selectList:(根据参数查询集合)
	*/
	public List<User> selectList(Map<String,Object> param){
		int start = Integer.parseInt(param.get("pageSize").toString()) * (Integer.parseInt(param.get("pageNum").toString()) - 1);
		param.put("pageNum",start);
		return userdao.selectList(param);
	}



	/**
	 selectCount:(根据集合查询数量)
	*/
	public Long selectCount(Map<String,Object> param){
		return userdao.selectCount(param);
	}



}